package sixkey.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * ClassName:UserRole
 * Package:sixkey.domain.entity
 * Description
 *
 * @Author:@wenxueshi
 * @Create:2023/5/21 - 0:01
 * @Version:v1.0
 */

/**
 * 用户角色表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user_role") //对应数据库的表
@Accessors(chain = true) //可以链式编写
public class UserRole implements Serializable {
    @TableId // 主键
    private Long id;

    @ApiModelProperty(value = "角色id")
    private Long roleId;

    @ApiModelProperty(value = "用户id")
    private String userId;

    @TableField(fill = FieldFill.INSERT) //插入时自动填充
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE) //修改时自动填充
    private Date updateTime;
}
